$.urlParam = function(name){
	var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
	if (results==null){
		return null;
	}
	else{
		return results[1] || 0;
	}
};


var $time=1000;
var $id=$.urlParam('id');
setInterval(function(){$.ajax({
	url:"ajax_attenteTour.html?id="+$id,success:function(result){
		if(result == "1"){
			location.reload();
		}
		if(result=="2")
			location.href = "jouer.html?id="+$id;
	}
});},$time);	
